﻿@model IEnumerable<CloudFranceTriple.Models.LaBaffSet>

@{
    ViewBag.Title = CloudFranceTriple.WebRole.Properties.Resources.LaBaffIndexTitle;
    Layout = "~/Views/Shared/_Layout.cshtml";
}
<div class="content-padding">
    <h1>@CloudFranceTriple.WebRole.Properties.Resources.LaBaffIndexTitle</h1>
    <section>
        @if (User.IsInRole("RoleAdminLaBaff"))
        {
            <p>
                @Html.ActionLink(CloudFranceTriple.WebRole.Properties.Resources.ButtonCreate, "Create")
            </p>
        }
        @foreach (var item in Model)
        {
            if (!item.IsPublicVisible && !User.Identity.IsAuthenticated) { continue; }
            <ul style="list-style-type: none;">
                <li>
                    <h2>@Html.DisplayFor(modelItem => item.Name)</h2>
                </li>
                <li>[@Html.DisplayFor(modelItem => item.Tag)]
                </li>
                <li></li>
                <li>
                    <a target="_blank" href="@item.Website">
                        <img src="@item.BannerImageUrl" height="120" alt="Bannière de la team @item.Name" style="border-radius:8px;"/>
                    </a>
                </li>
                <li>
                    @Html.DisplayFor(modelItem => item.Description)
                </li>
                <li>
                    <a target="_blank" href="@item.Bf3PlatoonUrl">BF3 Platoon</a> |
                    <a target="_blank" href="@item.Bf4PlatoonUrl">BF4 Platoon</a> |
                    <a href="@item.TeamspeakIp" >TeamSpeak</a>
                </li>
                @if (User.IsInRole("RoleAdminLaBaff"))
                {
                    <li>
                        @*<td>
                            @Html.DisplayFor(modelItem => item.TeamSpeakPassword)
                        </td>*@
                        @Html.ActionLink(CloudFranceTriple.WebRole.Properties.Resources.ButtonEdit, "Edit", new { id = item.Id }) |
                        @Html.ActionLink(CloudFranceTriple.WebRole.Properties.Resources.ButtonDetails, "Details", new { id = item.Id }) |
                        @Html.ActionLink(CloudFranceTriple.WebRole.Properties.Resources.ButtonDelete, "Delete", new { id = item.Id })
                    </li>
                }
            </ul>
        }
        <br />
        <br />
    </section>
</div>
